package com.gs.disk.modules.headImgAndWallper.controller.mobile;


import com.github.xiaoymin.knife4j.annotations.ApiSort;
import com.gs.entity.R;
import com.gs.disk.modules.headImgAndWallper.entity.CategoryEntity;
import com.gs.disk.modules.headImgAndWallper.service.mobile.MobileCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("wallper/mobile/category")
@Api(tags = "光速壁纸--分类")
@ApiSort(1)
public class MobileCategoryController {

    @Resource
    private MobileCategoryService mobileCategoryService;

    @GetMapping("list")
    @ApiOperation("查看所有分类列表")
    @Cacheable(value = "categoryList", keyGenerator = "myKeyGenerator")
    public R<List<CategoryEntity>> list() {
        List<CategoryEntity> categoryEntityList = mobileCategoryService.list();
        return R.ok(categoryEntityList);
    }


}
